printf("StartMenu is now running.\nMove the mousepointer to the bottom of the screen to open the menu.\nThis demo may cause deadlocks (e.g. if you move an icon to the bottom of the screen), but they should be solved quickly.\nA better startmenu example will follow soon...\n");
while(r) {
Delay(4); // A CX object would be better...
if(scr->MouseY>scr->Height-3) { // If we're somewhere near the bottom of the screen...
w.MouseX=scr->MouseX;
r=(ULONG)(PM_OpenPopupMenu(&w, // Open our start menu!
PM_Menu, p,
PM_WideSelectBar, TRUE,
PM_SameHeight, FALSE,
PM_SmartRefresh, TRUE,
// No PM_Code here, since we don't open the menu when the mouse button is clicked/released
TAG_DONE));
switch(r) {
/* Take care of the return codes here. (PM_UserData is returned) */
case 30:
system("Run COMM:YAM/YAM");
break;
case 20:
system("Run COMM:IBrowse/IBrowse");
break;
case 10:
system("Run COMM:Miami/Miami");
break;
}
r-=5; // When we get a 5 from OpenPopupMenu we make it into a 0, and the program exits!